package itheima.chap05;

import java.util.Scanner;

public class ConditionControl {
    public static void main(String[] args) {
            // 商品原价
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入商品原价：");
            double price = scanner.nextDouble();
            System.out.println("商品原价：" + price);

            // 1.商品打折，满300元减100元
        /*if (price >= 300) {
            price -= 100; //price = price - 100;
        }
        System.out.println("打折后价格：" + price);*/

            // 2.购物赠礼物，满两百赠一瓶生抽，否则送一颗大蒜头
            if (price >= 200) {
                System.out.println("送一瓶生抽");
            } else {
                System.out.println("送一颗大蒜头");
            }

            // 3.商品分级打折，满300元打九折，满500元打八折，满1000元打七折
            if (price >= 1000){
                price *= 0.7;
            }else if(price >= 500){
                price *= 0.8;
            }else if(price >= 300){
                price *= 0.9;
            }else {
                System.out.println("没有打折");
            }
            System.out.println("打折后价格：" + price);

        }
    }


